<?php

// +---------------------------------------------------
// | Name：星空框架 快递配送模板规则
// +---------------------------------------------------
// | Version: V5.0
// +---------------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +---------------------------------------------------
// | Time: 2021-04-21 09:26
// +---------------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 快递配送模板规则
 */
class ShippingTemplate extends Validate
{
    protected $rule = [
    'shipping_type_id' => 'number|min:1',
    'shipping_type_name' => 'require|min:2|max:100',
    'area_code' => 'require', //不允许出现负数
    'area_show' => 'require',
    'price' => 'require|float|between:0,9999999999999999.99',
  ];
    protected $message = [
    'shipping_type_id' => '请选择需要操作的运费模板',
    'shipping_type_name' => '请填写运费模板名称',
    'area_code' => '请选择运费指定区域',
    'area_show' => '请选择指定区域',
    'price' => '请填写运费',
  ];
    protected $scene = [
    'create' => ['shipping_type_name', 'area_code', 'area_show', 'price'],
    'edit' => ['shipping_type_id', 'shipping_type_name', 'area_code', 'area_show', 'price']
  ];
}
